﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace PluginAmazon
{
    public partial class AmazonControl : UserControl
    {
        public AmazonControl()
        {
            InitializeComponent();
        }

        private void SearchButton_Click(object sender, EventArgs e)
        {
            //AmazonWS.AWSECommerceService ws = new PluginAmazon.AmazonWS.AWSECommerceService();
            //AmazonWS.ItemSearch search = new PluginAmazon.AmazonWS.ItemSearch();
            //search.AWSAccessKeyId = "1MAAHFTFECEZ3DVMM502";
            //AmazonWS.ItemSearchRequest request = new PluginAmazon.AmazonWS.ItemSearchRequest();
            //request.SearchIndex = "Books";
            //request.Keywords = "XML";
            //search.Request = new PluginAmazon.AmazonWS.ItemSearchRequest[] { request };
            //AmazonWS.ItemSearchResponse response = ws.ItemSearch(search);
            //richTextBox1.Text = "";
            //for (int i = 0; i < response.Items.Length; i++)
            //{
            //    for (int j = 0; j < response.Items[i].Item.Length; j++)
            //        richTextBox1.Text = richTextBox1.Text + "|" + response.Items[i].Item[j].ASIN;
            //}

            AmazonKey key = new AmazonKey("AccessKey", "SecretKey");
            string filename = @"C:\keys.xml";
            key.Serialize(filename);

            AmazonKey deserialize = AmazonKey.Deserialize(filename);
        }
    }
}
